package com.hunttown.mes.common.utils;

import org.apache.commons.pool.impl.GenericObjectPool;

/**
 * created by hunttown on 2017/7/27
 */
public class GenericHttpClientPool extends GenericObjectPool {
    private static GenericHttpClientPool pool = null;

    private GenericHttpClientPool() {
        super(new PoolHttpClientFactory());
    }

    public static GenericHttpClientPool getPool() {
        if (pool == null) {
            pool = new GenericHttpClientPool();
            pool.setMaxActive(50);
            pool.setMaxIdle(50);
            pool.setMaxWait(5000);
        }
        return pool;
    }
}
